using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Collections.Generic;

namespace Widgetsphere.AutoAggregate.Website.Objects
{
	public class GeoCodeCollection : List<GeoCode>
	{
		#region Property Implmentations

		public GeoCode this[decimal latitude, decimal longitude]
		{
			get
			{
				foreach (GeoCode item in this)
				{
					if ((latitude == item.Latitude) && (longitude == item.Longitude))
					{
						return item;
					}
				}
				return null;
			}
		}

		#endregion

		#region Methods

		public new bool Contains(GeoCode geoCode)
		{
			foreach (GeoCode item in this)
			{
				if ((geoCode.Latitude == item.Latitude) && (geoCode.Longitude == item.Longitude))
				{
					return true;
				}
			}
			return false;
		}

		public bool Contains(decimal latitude, decimal longitude)
		{
			foreach (GeoCode item in this)
			{
				if ((latitude == item.Latitude) && (longitude == item.Longitude))
				{
					return true;
				}
			}
			return false;
		}

		#endregion

	}
}
